import { h } from 'preact';

export function Circle(props) {
  const { x = 0, y = 0} = props;
  const attrs = {
    // default
    r: 10,
    fill: 'transparent', fillOpacity: 1,
    strokeWidth: '1', stroke: '#000', strokeOpacity: 1,

    ...props,
    cx: x,
    cy: y, 
  };

  return (
    <circle {...attrs} />
  );
};

export function getCircleAnchors(props) {
  const { x = 0, y = 0, r = 10 } = props;
  return [
    { x: x + r, y: y },
    { x, y: y + r  },
    { x: x- r, y },
    { x, y: y - r }
  ]
}
